package com.ht.safe.entity;

import org.hibernate.annotations.Index;

import javax.persistence.Column;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

/**
 * Created with IntelliJ IDEA.
 *
 * @author: 薄成文 13-7-19 上午11:08
 * To change this template use File | Settings | File Templates.
 */
public class Area {
    /**
     * 名称
     */
    @Index(name="idx_area_name")
    @Column(name="inner_code", unique = true, nullable = false)
    private String name;

    /**
     * 编号, 由用户指定
     */
    @Index(name="idx_area_code")
    private String code;

    /**
     * 安全等级
     */
    private Integer securityLevel;

    /**
     * 区域分组
     */
    @ManyToOne
    @JoinColumn(name = "area_group_id")
    private AreaGroup areaGroup;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Integer getSecurityLevel() {
        return securityLevel;
    }

    public void setSecurityLevel(Integer securityLevel) {
        this.securityLevel = securityLevel;
    }

    public AreaGroup getAreaGroup() {
        return areaGroup;
    }

    public void setAreaGroup(AreaGroup areaGroup) {
        this.areaGroup = areaGroup;
    }
}
